<html>
  <script>
    function toggleFullscreen() {
      if (!document.fullscreenElement) {
        document.getElementById('x').requestFullscreen();
      } else {
        document.exitFullscreen();
      }
    }
  </script>
  <body onclick="toggleFullscreen();">
    <p id='x'>X</p>
  </body>
</html>
